﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OculusWrap;
using SharpDX.Direct3D11;
using ovrBool = System.Byte;
using ovrSession = System.IntPtr;

namespace OculusWrapTest.DX11
{
	[TestClass]
	public class OVRUnsafeTest	:OVRTest
	{
		#region Test setup
		/// <summary>
		/// Initialize the Oculus VR runtime.
		/// </summary>
		[TestInitialize]
		public override void Initialize()
		{
			if(Environment.Is64BitProcess)
				OVR = new OVR64Unsafe();
			else
				OVR = new OVR32Unsafe();

			OVRTypes.InitParams	initializationParameters	= new OVRTypes.InitParams();
			initializationParameters.Flags					= OVRTypes.InitFlags.Debug;
			initializationParameters.ConnectionTimeoutMS	= 0;
			initializationParameters.RequestedMinorVersion	= 0;
			initializationParameters.LogCallback			= LogCallback;

			OVRTypes.Result result = OVR.Initialize(initializationParameters);
			Assert.IsTrue(result >= OVRTypes.Result.Success);
		}
		#endregion
	}
}

